package Classes.Managers// ActionScript file
{
	import Classes.GameUtils.GU_DataTransform;

	/**
	 *换装动画管理类 
	 * @author upstream
	 * 
	 */	
	public class M_PaperManCartoons extends Manager
	{
		private static var _instance:M_PaperManCartoons;/*静态引用*/
		private var _suitsSetDataObj:Object;
		public function M_PaperManCartoons():void
		{
			_instance=this;
			this.init();
		}
		
		private function init():void
		{
			this._suitsSetDataObj=new Object;
		}
		
		override public function importData():void
		{
			var suitsSetCSV:String=M_ConfigData.instance.getCSVByName("纸娃娃换装配置表");
			var suitsSetAry:Array=GU_DataTransform.csvTransformObjsAry(suitsSetCSV,44);
			for(var i:int=0;i<suitsSetAry.length;i++)
			{
				var suitSetDataObj:Object=suitsSetAry[i];
				if(!this.suitsSetDataObj.hasOwnProperty(suitSetDataObj.suitName))
				{
					this.suitsSetDataObj[suitSetDataObj.suitName]=new Object;
					this.suitsSetDataObj[suitSetDataObj.suitName].suitType=suitSetDataObj.suitType;
					this.suitsSetDataObj[suitSetDataObj.suitName].skinsSource=suitSetDataObj.skinsSource;
					this.suitsSetDataObj[suitSetDataObj.suitName].suitSkins=new Object;
				}
				this.suitsSetDataObj[suitSetDataObj.suitName].suitSkins[suitSetDataObj.actionName]=suitSetDataObj;
			}
			this.importOver(3);
		}
		
		public function getSuitSetObjByName(suitName:String):Object
		{
			if(!this.suitsSetDataObj.hasOwnProperty(suitName))throw new Error("没有该套衣服");
			return this.suitsSetDataObj[suitName];
		}

		/*getter & setter*/
		public static function get instance():M_PaperManCartoons
		{
			return _instance;
		}

		public function get suitsSetDataObj():Object
		{
			return _suitsSetDataObj;
		}


	}
}